<div class="items">
	<div class="container">
		<div class="row">

			<div class="span3 hidden-phone">

				<h5 class="title">Danh mục sản phẩm</h5>

				<!-- Sidebar navigation -->
				<nav>
					<ul id="nav">
						<?php
						createListCategory();
						?>
					</ul>
				</nav>
				<br>
			</div>

			<div class="span9">

				<div class="row">
<?php
		$hostname_connect = "localhost";
		$database_connect = "advertisement";
		$username_connect = "root";
		$password_connect = "";	
		$connect = mysql_pconnect($hostname_connect, $username_connect, $password_connect) or trigger_error(mysql_error(),E_USER_ERROR);
		mysql_query("set names 'utf8'");
?>
<?php
mysql_select_db($database_connect, $connect);

  /*if (!isset($_GET['page'])) {
   $_GET['page'] = 1;
  }
  $vitri = ($_GET['page'] – 1) * 12;*/
$query_detail = "SELECT * FROM  `product` limit 0,12";
$detail = mysql_query($query_detail, $connect) or die(mysql_error());
$row_detail = mysql_fetch_assoc($detail);
$totalRows_detail = mysql_num_rows($detail);
?>
<?php
        if (isset($row_detail) && is_array($row_detail)) {
          do { //Nested repeat
?>
					<!-- Item #1 -->
					<div class="span3">
						<div class="item">
							<!-- Item image -->
							<div class="item-image">
								<a href="estoreid.php?id=<?php echo $row_detail['EUserID']; ?>"><img src="<?php echo $row_detail['Image']; ?>" alt=""></a>
							</div>
							<!-- Item details -->
							<div class="item-details">
								<!-- Name -->
								<!-- Use the span tag with the class "ico" and icon link (hot, sale, deal, new) -->
								<h5><a href="estoreid.php?id=<?php echo $row_detail['EUserID']; ?>"><?php echo $row_detail['Manufacturer']; ?></a><span class="ico"><img src="img/hot.png" alt=""></span></h5>
								<div class="clearfix"></div>
								<!-- Para. Note more than 2 lines. -->
								<p>
									Ngày tạo: <?php echo $row_detail['CreatedDate']; ?>
								</p>
								<hr>
								<!-- Price -->
								<div class="item-price pull-left">
									$<?php echo $row_detail['Price']; ?>
								</div>
								<!-- Add to cart -->
								<div class="button pull-right"></div>
								<div class="clearfix"></div>
							</div>
						</div>
					</div>
<?php
		}
		  while ($row_detail = mysql_fetch_assoc($detail));
		}
		/*
$re = mysql_query(‘select * from `product`’);
$n = mysql_num_rows($re);
$tong_so_trang = floor($n/12) + 1;
echo ‘Tong so trang la: ‘.$tong_so_trang;*/
?>
					
					<div class="span9">
						<!-- Pagination -->
						<div class="paging">
						<?php
						/*if ($_GET['page'] > 1) { echo ‘<a href=”index.php?page=’.($_GET['page']-1).’”>back</a> ‘;}

						 for ($i=1 ; $i<=$tong_so_trang ; $i++) {
						   if ($i == $_GET['page']) {
								echo ‘[Trang'.$i.'] ‘;
						   } else {
							   echo ‘<a href=”index.php?page=’.$i.’”>Trang’.$i.’</a> ‘;
							}
						  }

						if ($_GET['page'] < $tong_so_trang) { echo ‘ <a href=”index.php?page=’.($_GET['page']+1).’”>next</a>’;}
						*/?>

						</div>
					</div>

				</div>

			</div>
		</div>
	</div>
</div>